package com.example.vueserver.vueserver.service;

import com.example.vueserver.vueserver.bean.SysRole;
import com.example.vueserver.vueserver.dao.SysRoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("sysRoleService")
public class SysRoleService {
    @Autowired
    private SysRoleMapper roleMapper;

    public SysRole selectById(Integer id){
        return roleMapper.selectById(id);
    }
    public SysRole selectByName(String roleName){
        return roleMapper.selectByName(roleName);
    }
    public List<SysRole> listUserRoles(Integer userId){
        return this.roleMapper.listUserRoles(userId);
    };

    public List<SysRole> listAll() {
        return  this.roleMapper.listAll();
    }
}
